package org.example.exp3.exam4;

import org.example.exp3.utils.XMLUtil;

public class Client {
    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();
        // 5个插槽对应的发送指令
        Command command1, command2, command3, command4, command5;
        command1 = (Command) XMLUtil.getBean(
                "src/test/java/org/example/exp3/exam4/config.xml",
                "Slot1");
        command2 = (Command) XMLUtil.getBean(
                "src/test/java/org/example/exp3/exam4/config.xml",
                "Slot2");
        command3 = (Command) XMLUtil.getBean(
                "src/test/java/org/example/exp3/exam4/config.xml",
                "Slot3");
        command4 = (Command) XMLUtil.getBean(
                "src/test/java/org/example/exp3/exam4/config.xml",
                "Slot4");
        command5 = (Command) XMLUtil.getBean(
                "src/test/java/org/example/exp3/exam4/config.xml",
                "Slot5");

        remoteControl.setCommandList(new Command[]{command1, command2, command3, command4, command5});

        //执行command3
        remoteControl.execute(3);
    }
}